package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.sql.DataSource;

import java.sql.Connection;
import java.util.List;


@Repository
public class GoodsDaoImpl  implements GoodsDao{
    @Autowired
    private SqlSession sqlSession;
    @Override
    public List<Goods> findGoods() {//在此方法内部使用sqlsession实现数据库会话
        System.out.println("==findGoods==");
        String statment="com.cy.pj.goods.dao.GoodsDao.findGoods";//namespace+id

        return  sqlSession.selectList(statment);
    }

    @Override
    public int deleteById(Integer id) {
        String statement="com.cy.goods.dao.GoodsDao.deleteById";
        return 0;
    }
}
